/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bioinformatica;

/**
 *
 * @author Ale
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        //Cadenas a comparar.
        String s = "DYLIVIGVVSIILALVCYPLWPRSMRRGSYYVSLGAFGILAGFFAVAILRLILYVLSLIVYKDVGGFWIFPNLFEDCGVLESFKPLYGFGEKDTYSYKKKLKRMKKKQAKRESNKKKAINEKAEQN,MMTRESIDKRAGRRGPNLNIVLTCPECKVYPPKIVERFSEGDVVCALCGLVLSDKLVDTRSEWRTFSNDDHNGDDPSRVGEASNPLLDGNNLSTRIGKGETTDMRFTKELNKAQGKNVMDKKDNEVQAAFAKITMLCDAAELPKIVKDCAKEAYKLCHDEKTLKGKSMESIMAASILIGCRRAEVARTFKEIQSLIHVKTKEFGKTLNIMKNILRGKSEDGFLKIDTDNMSGAQNLTYIPRFCSHLGLPMQVTTSAEYTAKKCKEIKEIAGKSPITIAVVSIYLNILLFQIPITAAKVGQTLQVTEGTIKSGYKILYEHRDKLVDPQLIANGVVSLDNLPGVEKK";
        String t = "MEETIENVEVPSSNVSKQNDDGLDMKTLFVRSIPQDVTDEQLADFFSNFAPIKHAVVVKDTNKRSRGFGFVSFAVEDDTKEALAKARKTKFNGHILRVDIAKRRDRSKKTSEVVEKSTPESSEKITGQNNEDEDDADGEDSMLKGKPKLIIRNMPWSCRDPVKLKKIFGRYGTVVEATIPRKRDGKLCGFAFVTMKKISNCRIALENTKDLKIDGRKVAVDFAVQKNRWEDYKKAQPEMNDKDDNESGNEDAEENHDDEEDENEEEDRQVDQASKNKESKRKAQNKREDFSVFVRNVPYDATEESLAPHFSKFGSVKYALPVIDKSTGLAKGTAFVAFKDQYTYNECIKNAPAAGSTSLLIGDDVMPEYVYEGRVLSITPTLVREDAGRMAEKNAAKRKEALGKAPGEKDRRNLYLLNEGRVVEGSKMADLLTNTDMEIREKSYKLRVEQLKKNPSLHLSMTRLAIRNLPRAMNDKALKALARKAVVEFATEVKNKERHPLSKEEIIRSTKEKYKFMGPDEIEAQKKKDKKSGVVKQAKVIMEVKGSTAGRSRGYGFVEFRDHKNALMGLRWLNCHAVTSDEILEGLNDDEKKQVDNDLGKGRRLCVEFAIENSNVVKRRREQLKQARTKRTRPDNEDTGDVGESENKKPKKEEATTPTNPDDKKMGDDIKRIIGFKRKRKHAKK,MSQRKLQQDIDKLLKKVKEGIEDFDDIYEKFQSTDPSNSSHREKLESDLKREIKKLQKHRDQIKTWLSKEDVKDKQSVLMTNRRLIENGMERFKSVEKLMKTKQFSKEALTNPDIIKDPKELKKRDQVLFIHDCLDELQKQLEQYEAQENEEQTERHEFHIANLENILKKLQNNEMDPEPVEEFQDDIKYYVENNDDPDFIEYDTIYEDMGCEIQPSSSNNEAPKEGNNQTSLSSIRSSKKQERSPKKKAPQRDVSISDRATTPIAPGVESASQSISSTPTPVSTDTPLHTVKDDSIKFDNSTLGTPTTHVSMKKKESENDSEQQLNFPPDRTDEIRKTIQHDVETNAAFQNPLFNDELKYWLDSKRYLMQPLQEMSPKMVSQLESSLLNCPDSLDADSPCLYTKPLSLPHPTSIFFPNEPIRFVYPYDVPLNLTNNENDTDNKFGKDSKAKSKKDDDIYSRTSLARIFMKFDLDTLFFIFYHYQGSYEQFLAARELFKNRNWLFNKVDRCWYYKEIEKLPPGMGKSEEESWRYFDYKKSWLARRCGNDFVYNEEDFEKL";

        //Longitud de maximas secuencias buscar, valor de p > 2.
        int p = 200;

        //Lambda es el peso para realizar la ponderacion, entre 0 y 1.
        double lambda = 0.5;

        //Contendra los resultados obtenidos luego de cada calculo.
        double[] resultado;

        KernelString kernel = new KernelString();
        
        //Calculando mediante Gap-Weighted Subsequences Kernel.
        resultado = kernel.calcularPorGWSK(s, t, s.length(), t.length(), p, lambda);
        System.out.println("********************************************************");
        System.out.println("*Resultados utilizando Gap-Weighted Subsequences Kernel*");
        System.out.println("********************************************************");
        for (int i = 1; i < resultado.length; i++) {
            System.out.println("El valor del kernel para subsecuencias de tamanho " + (i + 1) + " es: " + resultado[i]);
        }
        
        //Calculando mediante Weighting by Number of Gaps.
        resultado = kernel.calcularPorGWSK(s, t, s.length(), t.length(), p, lambda);
        System.out.println("***************************************************");
        System.out.println("*Resultados utilizando Weighting by Number of Gaps*");
        System.out.println("***************************************************");
        for (int i = 1; i < resultado.length; i++) {
            System.out.println("El valor del kernel para subsecuencias de tamanho " + (i + 1) + " es: " + resultado[i]);
        }
    }
}
